<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章详情</title>
    <style>
         *{
            padding:0;
            margin:0;
        }
        body{
            background:grey;
        }
        #page{
            background:white
        }
        @media screen and (min-width:600px){
        #bigBlock{
            width:50%;
            margin:0 auto;
        }
        }
        #page ul{
            list-style:none;
        }
    </style>
</head>
<body>
    <div id="bigBlock">
        <div id="menu">
        <ul>
            <li>
            <a href="lifeShare.html">生活分享</a> 
            </li>
            <li>
            <a href="pageShare.html">文章</a>
            </li>
            <li>
            <a href="#">网友留言</a>
            </li>
        </ul>
        </div>
        当前位置：<a href="index.html">主页</a>-><a href="pageShare.html">文章列表</a>-><span></span>
        <div id="page">
        </div>
        <p style="color:white;" align="center">版权所有</p>
    </div>
</body>
<script>
    var pageListNum = window.location.search.slice(4)
    var span = document.querySelector("span")
    var page = document.querySelector("#page")
    function ajax(method,url,pageNum,hs){
        var xmlhttp
        var res
        if(window.XMLHttpRequest){
            xmlhttp = new XMLHttpRequest()
        }else{
            xmlhttp = new ActiveXObject("Microsoft XMLHTTP")
        }
        xmlhttp.open(method,url)
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
        xmlhttp.send('pageListNum='+pageNum);
        xmlhttp.onreadystatechange=function(){
            if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
            res = JSON.parse(xmlhttp.responseText)
            hs(res)
            }
        }
    }
    ajax('post','pageShareInfo.php',pageListNum,function(res){
        span.innerHTML = res[0].title
        var h1 = document.createElement("h1")
        h1.innerHTML = res[0].title
        page.appendChild(h1)
        var text = document.createTextNode(res[0].content)
        page.appendChild(text)
        // page.innerHTML = res[0].content
        
    }
    )
</script>
</html>